import request from "@/api/request";
import type { SunnyNotice } from "@/types/sunnyNotice/type";
import type { AxiosPromise } from "axios";
export function listNoticeApi(): AxiosPromise<SunnyNotice[]> {
  return request({
    method: "get",
    url: "/sunnyNotice",
  });
}
//批量更新通知
export function updateNoticesApi(data: SunnyNotice[]) {
  return request({
    method: "put",
    url: "/sunnyNotice",
    data,
  });
}

//全部标为已读
export function updateAllNoticesApi() {
  return request({
    method: "put",
    url: "/sunnyNotice/readAll",
  });
}

//批量删除通知
export function deleteNoticesApi(ids: string) {
  return request({
    method: "delete",
    url: "/sunnyNotice/" + ids,
  });
}

//全部删除
export function deleteAllNoticesApi() {
  return request({
    method: "delete",
    url: "/sunnyNotice",
  });
}
